package com.baitengsoft.patentservicemonitor.job.utils;

/**
 * @author wangze
 * @date 2018-03-07 13:22.
 **/
public class ExceptionUtils {

    public static String getExceptionDetail(Exception e) {
        StringBuilder builder = new StringBuilder(e.toString() + "\n");
        StackTraceElement[] messages = e.getStackTrace();
        int length = messages.length;
        for (int i = 0; i < length; i++) {
            builder.append("\t" + messages[i].toString() + "\n");
        }
        return builder.toString();
    }

}
